<html>
<head>
<script type="text/javascript" src="js/TangledModel.js"></script>
<script type="text/javascript" src="js/TangledView.js"></script>
<script type="text/javascript" src="js/TangledController.js"></script>
</head>
<body bgcolor="#000000">
<script type="text/javascript">
function get_window_size() {
	// adapted from here:
	// http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
	var o = {w: 0, h: 0};

	if ( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		o.w = window.innerWidth;
		o.h = window.innerHeight;
	} else if ( 
			document.documentElement && ( 
				document.documentElement.clientWidth || 
				document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		o.w = document.documentElement.clientWidth;
		o.h = document.documentElement.clientHeight;
	} else if ( 
			document.body && 
			( document.body.clientWidth || 
			  document.body.clientHeight ) ) {
		//IE 4 compatible
		o.w = document.body.clientWidth;
		o.h = document.body.clientHeight;
	}
	return o;
}

	var grid = new TangledGrids(3, 16, 16);
	var s = get_window_size();
	var w = new TangledWindow(grid, 0, 0, 
			Math.floor(s.w / 64), 
			Math.floor(s.h / 64));
	var c = new TangledController();
	document.tangled_control = c;
	c.add_window(w);
	do {
		grid.trace_any();
	} while (.5 > Math.random());

	w.draw();
	w.update();
	c.auto_click(w.guid, 15000, 60000);
	c.auto_click(w.guid, 5000, 5000, 0, 1);
</script>
</body>
